<?php
class HomeIndex extends AbstractController{	
	public $tplOff = array("sncListModule","sncListTemplate");
	public function sncIndex(){
		//take change from listmodule
		if(isset($_POST["status"]) && isset($_POST["position"])){
			$data = array("status"=>$_POST["status"],
						  "position"=>"'".$_POST["position"]."'");	
			
			$where = " name = '".$_POST["name"]."'";	
			$model = new Admin_Home_Model_ListModule();		
			$moduleName = $_POST["name"];
			$model->updateModule($data,$where,$moduleName);
		}
		//take change from listmodule
		if(isset($_POST["templateName"])){
			$data = array("int_using"=>1);				
			$model = new Admin_Home_ListTemplate();		
			$templateName = $_POST["templateName"];
			$where = "str_name = '".$templateName."'";
			$model->updateTemplate($data,$where,$templateName);
		}
		
	}
	
	public function sncListModule(){
		$model = new Admin_Home_Model_ListModule();
		View::assign("listModule", $model->browse());
	}
	
	public function sncListTemplate(){
		$model = new Admin_Home_ListTemplate();
		View::assign("listTemplate", $model->browse());
	}
}